/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pb138.ulohy.uloha3.managers;

import cz.muni.fi.pb138.ulohy.uloha3.entities.Owner;
import cz.muni.fi.pb138.ulohy.uloha3.exceptions.OwnerManagerException;
import java.util.Set;
import javax.sql.DataSource;

/**
 *
 * @author stefan
 */
public interface OwnerManager {
    
    /**
     * 
     * @param owner
     * @throws OwnerManagerException if owner is {@code null}, 
     *          if owner.ssn, owner.firstName or owner.lastName is {@code null} 
     *          or if there was an SQLException
     */
    public void addOwner(Owner owner) throws OwnerManagerException;
    
    /**
     * 
     * @param owner  {@link Owner} to be edited
     * @throws OwnerManagerException if owner is {@code null}, 
     *          if owner.id, owner.ssn, owner.firstName or owner.lastName is {@code null} 
     *          or if there was an SQLException
     */
    public void editOwner(Owner owner) throws OwnerManagerException;
    
    /**
     * 
     * @param owner {@link Owner} to be deleted
     */
    public void deleteOwner(Owner owner) throws OwnerManagerException;
    
    /**
     * 
     * @return <code>Set</code> of all the {@link Owner}s
     * @throws OwnerManagerException if there was an SQLException
     */
    public Set<Owner> getOwners() throws OwnerManagerException;
    
    /**
     * 
     * @param id
     * @return
     * @throws OwnerManagerException if id is null
     */
    public Owner getOwnerById(Long id) throws OwnerManagerException;
    
    public void setDataSource(DataSource datasource);
}
